package com.itheima.data;

import java.time.LocalDateTime;
import java.util.Objects;
/*
数据层
客户信息类
 */
public class Customer {
    private String id;//银行账户
    private String name;//客户姓名
    private int age;//客户年龄
    private String gender;//性别
    private boolean maritalStatus;//婚姻状况 false 未婚  true 已婚
    private String education;//学历
    private double income;//客户收入
    private double debt;//客户债务
    private LocalDateTime creditCardCreateTime;//信用卡开卡时间

    public Customer() {
    }

    public Customer(String id, String name, int age, String gender, boolean maritalStatus, String education, double income, double debt, LocalDateTime creditCardCreateTime) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.maritalStatus = maritalStatus;
        this.education = education;
        this.income = income;
        this.debt = debt;
        this.creditCardCreateTime = creditCardCreateTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public boolean isMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(boolean maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    public String getEducation() {
        return education;
    }

    public void setEducation(String education) {
        this.education = education;
    }

    public double getIncome() {
        return income;
    }

    public void setIncome(double income) {
        this.income = income;
    }

    public double getDebt() {
        return debt;
    }

    public void setDebt(double debt) {
        this.debt = debt;
    }

    public LocalDateTime getCreditCardCreateTime() {
        return creditCardCreateTime;
    }

    public void setCreditCardCreateTime(LocalDateTime creditCardCreateTime) {
        this.creditCardCreateTime = creditCardCreateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customer customer = (Customer) o;
        return age == customer.age && maritalStatus == customer.maritalStatus && Double.compare(customer.income, income) == 0 && Double.compare(customer.debt, debt) == 0 && Objects.equals(id, customer.id) && Objects.equals(name, customer.name) && Objects.equals(gender, customer.gender) && Objects.equals(education, customer.education) && Objects.equals(creditCardCreateTime, customer.creditCardCreateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, age, gender, maritalStatus, education, income, debt, creditCardCreateTime);
    }

    @Override
    public String toString() {
        return "Customer{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", maritalStatus=" + maritalStatus +
                ", education='" + education + '\'' +
                ", income=" + income +
                ", debt=" + debt +
                ", creditCardCreateTime=" + creditCardCreateTime +
                '}';
    }
}
